package com.example.dangerouscargodriver.ui.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.example.dangerouscargodriver.R;
import com.example.dangerouscargodriver.utils.AppManager;
import com.example.dangerouscargodriver.widget.ActionBar;

public class OrderSuccessActivity extends AppCompatActivity {

    private ActionBar mActionBar = null;
    private TextView mCheckDetail = null;

    private String mOrderId = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_order_success);

        mOrderId = getIntent().getStringExtra("id");

        mCheckDetail = findViewById(R.id.tv_action_check_detail);
        mCheckDetail.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(mOrderId != null) {
                    Intent intent = new Intent(OrderSuccessActivity.this, MyOrderDetailInfoActivity.class);
                    intent.putExtra("id", mOrderId);
                    startActivity(intent);
                    finish();
                }
            }
        });

        mActionBar = findViewById(R.id.actionBarOrderSuccess);
        mActionBar.setOnBackClickListener( new View.OnClickListener(){

            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}